<script setup>
import user from "./user.vue";
import menuTab from "@/views/libaray/content/menuTab.vue";
import { onActivated, ref } from "vue";
import { debounce } from "lodash";

const scrollbar = ref();
const height = ref();
//保存滚动条高度
const handleScroll = debounce((data) => {
  height.value = data.scrollTop;
}, 200);

onActivated(() => {
    scrollbar.value.wrap$.scrollTop = height.value;
  // scrollbar.value.wrap$.scrollTo({ behavior: "smooth", top: 1600 });
});
</script>

<template>
  <div class="libaray-wrap">
    <el-scrollbar  ref="scrollbar" @scroll="handleScroll" style="height: 100%">
      <user></user>
      <menuTab></menuTab>
    </el-scrollbar>
  </div>
</template>

<style scoped lang="scss">
.libaray-wrap{
  height: 100%;
}
</style>
